const Mock = require('mockjs')

const List6 = []
const count6 = 2
for (let i = 0; i < count6; i++) {
  List6.push(Mock.mock({
    id: '@id',
    test_time: '@datetime'
  }))
}

const data6 = Mock.mock({
  chip_id: '@id',
  name: '@title(5, 10)',
  supplier: '@title(1, 3)',
  chip_no: +Mock.Random.date('T'),
  raycus_no: +Mock.Random.date('T'),
  test_time: '@datetime',
  test_content: '@title(5, 10)',
  module_type: '@title(1, 3)',
  report_file_url: 'http://192.168.0.11/file/download/长期可靠性验证报告.xlxs',
  params: [
    {
      position: '未来城',
      sn: 'A1AR61223YF002',
      project: '芯片验证',
      module_type: '500W976',
      aging_current: '30',
      state: '无失效',
      final_power: '501',
      weeks: [
        {
          id: '1',
          test_time: 1641916800000,
          test_value: 500
        }, {
          id: '2',
          test_time: 1642435200000,
          test_value: 495
        }, {
          id: '3',
          test_time: 1643040000000,
          test_value: 488
        }, {
          id: '4',
          test_time: 1643731200000,
          test_value: 476
        }, {
          id: '5',
          test_time: 1644681600000,
          test_value: 515
        }, {
          id: '6',
          test_time: 1645891200000,
          test_value: 502
        }, {
          id: '7',
          test_time: 1646409600000,
          test_value: 501
        }, {
          id: '8',
          test_time: 1647532800000,
          test_value: 498
        }, {
          id: '9',
          test_time: 1648483200000,
          test_value: 502
        }
      ],
      af: '5.85',
      total_test_time: '7881.6'
    },
    {
      position: '未来城',
      sn: 'A1AR61223YF002',
      project: '芯片验证',
      module_type: '500W976',
      aging_current: '30',
      state: '一周失效一颗，COS4',
      final_power: '502',
      weeks: [
        {
          id: '1',
          test_time: 1641916800000,
          test_value: 500
        }, {
          id: '2',
          test_time: 1642435200000,
          test_value: 495
        }, {
          id: '3',
          test_time: 1643040000000,
          test_value: 488
        }, {
          id: '4',
          test_time: 1643731200000,
          test_value: 476
        }, {
          id: '5',
          test_time: 1644681600000,
          test_value: 515
        }, {
          id: '6',
          test_time: 1645891200000,
          test_value: 502
        }, {
          id: '7',
          test_time: 1646409600000,
          test_value: 501
        }, {
          id: '8',
          test_time: 1647532800000,
          test_value: 498
        }, {
          id: '9',
          test_time: 1648483200000,
          test_value: 502
        }
      ],
      af: '5.85',
      total_test_time: '7881.6'
    },
    {
      position: '保税区',
      sn: 'A1AR61223YF002',
      project: '芯片验证',
      module_type: '500W976',
      aging_current: '30',
      state: '一周失效一颗，COS7',
      final_power: '511',
      weeks: [
        {
          id: '1',
          test_time: 1641916800000,
          test_value: 500
        }, {
          id: '2',
          test_time: 1642435200000,
          test_value: 495
        }, {
          id: '3',
          test_time: 1643040000000,
          test_value: 488
        }, {
          id: '4',
          test_time: 1643731200000,
          test_value: 476
        }, {
          id: '5',
          test_time: 1644681600000,
          test_value: 515
        }, {
          id: '6',
          test_time: 1645891200000,
          test_value: 502
        }, {
          id: '7',
          test_time: 1646409600000,
          test_value: 501
        }, {
          id: '8',
          test_time: 1647532800000,
          test_value: 498
        }, {
          id: '9',
          test_time: 1648483200000,
          test_value: 502
        }
      ],
      af: '5.85',
      total_test_time: '7881.6'
    }
  ],
  rated_current: 1,
  rated_power: 1,
  rated_junction_temperature: 1,
  rated_junction_temperature_kelvin: 1,
  burn_in_current: 1,
  burn_in_power: 1,
  burn_in_junction_temperature: 1,
  burn_in_junction_temperature_kelvin: 1,
  activation_energy: 1,
  x_factor: 1,
  y_factor: 1,
  boltzmann_constant: 1,
  current_acceleration_factor: 1,
  power_acceleration_factor: 1,
  temperature_acceleration_factor: 1,
  total_acceleration_factor: 1,
  confidence_coefficient: 1,
  invalid_number: 1,
  chi_square: 1,
  total_test_time: 1,
  failure_rate: 1,
  mean_time_between_failure: 1,
  acceleration_factor: 1,
  rated_failure_rate: 1,
  accelerated_failure_rate: 1
})

module.exports = [
  {
    url: '/reliability_report/history',
    type: 'get',
    response: config => {
      const { chipId } = config.query
      console.log('chipId', chipId)
      return {
        code: 0,
        data: List6
      }
    }
  },
  {
    url: '/reliability_report/info',
    type: 'get',
    response: config => {
      const { test_time } = config.query
      console.log('test_time', test_time)
      return {
        code: 0,
        data: data6
      }
    }
  }
]

